package mx.ipn.negocios;

import mx.ipn.*;
import mx.ipn.to.*;

public class UrlServidorBO {

	// is the business server connected to the persistence server? 
	private static boolean isConnected = false;
	
	// first time a client connect to the business server
	public static TransferObject conectar(){
		TransferObject resp = new TransferObject();
		
		if(!isConnected){
			resp.setTipoError(TransferObject.ERROR);
			resp.setError(CodigosDeError.error.get(3));
		}
		
		return resp;
	}
	
	public static void setUrl(String url){
		Constantes.setUrlServidorPersistencia(url);
	}
	
	public static void setPort(String port){
		Constantes.setPuertoServidorPersistencia(port);
	}
	
	public static void setConnected(boolean c){
		isConnected = c;
	}
}
